<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/10
 * Time: 19:00
 */

namespace app\admin\model\room;


use think\Model;

/***** 房间管理 ******/
class Room extends Model
{

    protected $table = 'fa_room';

    /**
     * 创建房间标识
     * */
    public function createRoom($order_id)
    {
        $insertData = [
            'order_id'=>$order_id,
            'status'=>'1',
            'createtime'=>date('Y-m-d H:i:s',time())
        ];
        self::insert($insertData);
    }

    /**
     * 销毁房间
     * */
    public function delRoom($order_id){
        self::where(['order_id'=>$order_id])->update(['status','9']);
        $room = new \app\common\library\tencent\Room();
        $room->destroyRoom($order_id);
    }
}